<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Libido Chateau</title>
  <meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">


<meta name="author" content="迷幻主义搬砖号子" /><meta name="description" content="搬砖前先定义问题。定义构成问题的每个关键概念，划出问题的边界。这是搬砖一整个肮脏而繁重的愚蠢过程中唯一具备哲学性的光辉阶段。" /><meta name="keywords" content="数据, 时评, 人文" />


<meta name="baidu-site-verification" content="k5CktWnwfR" />
<meta name="google-site-verification" content="lO7fVN8Jm2sjiBOcR2knmNBKjtWcxS6KbuZYl2yELwA" />


<meta name="generator" content="Hugo 0.108.0 with theme even" />


<link rel="canonical" href="https://madlogos.github.io/" />
  <link href="https://madlogos.github.io/index.xml" rel="alternate" type="application/rss+xml" title="Libido Chateau" />
  <link href="https://madlogos.github.io/index.xml" rel="feed" type="application/rss+xml" title="Libido Chateau" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">

<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

<link href="/sass/main.min.67ad89b7ca43747ca0757fa0c720e4a26dfb092d0c625a7e1f3b937263f7d48d.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" integrity="sha256-Vzbj7sDDS/woiFS3uNKo8eIuni59rjyNGtXfstRzStA=" crossorigin="anonymous">
<link rel="stylesheet" href="/css/custom.css">


<meta property="og:title" content="Libido Chateau" />
<meta property="og:description" content="搬砖前先定义问题。定义构成问题的每个关键概念，划出问题的边界。这是搬砖一整个肮脏而繁重的愚蠢过程中唯一具备哲学性的光辉阶段。" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://madlogos.github.io/" />

<meta itemprop="name" content="Libido Chateau">
<meta itemprop="description" content="搬砖前先定义问题。定义构成问题的每个关键概念，划出问题的边界。这是搬砖一整个肮脏而繁重的愚蠢过程中唯一具备哲学性的光辉阶段。"><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Libido Chateau"/>
<meta name="twitter:description" content="搬砖前先定义问题。定义构成问题的每个关键概念，划出问题的边界。这是搬砖一整个肮脏而繁重的愚蠢过程中唯一具备哲学性的光辉阶段。"/>

<!--[if lte IE 9]>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
<![endif]-->

<!--[if lt IE 9]>
  <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->

</head>
<body>
  <div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/" class="logo">Libido Chateau</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>
<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    <a href="/">
        <li class="mobile-menu-item">首页</li>
      </a><a href="/post/">
        <li class="mobile-menu-item">归档</li>
      </a><a href="/tags/">
        <li class="mobile-menu-item">标签</li>
      </a><a href="/categories/">
        <li class="mobile-menu-item">分类</li>
      </a><a href="/about/">
        <li class="mobile-menu-item">关于</li>
      </a>
  </ul>

  


</nav>

  <div class="container" id="mobile-panel">
    <header id="header" class="header">
        <div class="logo-wrapper">
  <a href="/" class="logo">Libido Chateau</a>
</div>





<nav class="site-navbar">
  <ul id="menu" class="menu">
    <li class="menu-item">
        <a class="menu-item-link" href="/">首页</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/post/">归档</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/tags/">标签</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/categories/">分类</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/about/">关于</a>
      </li>
  </ul>
</nav>

    </header>

    <main id="main" class="main">
      <div class="content-wrapper">
        <div id="content" class="content">
          <section id="posts" class="posts">
    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/london-trip-20202-5/">2020年初伦敦行(5)：自然史博物馆、西区音乐剧</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2020-02-13 </span>
      <div class="post-category">
          <a href="/categories/%E6%97%85%E6%B8%B8/"> 旅游 </a>
          </div>
        <span class="more-meta"> 约 1605 字 </span>
        <span class="more-meta"> 预计阅读 4 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <h2 id="1-30-伦敦">1-30 伦敦</h2>
<h3 id="自然史博物馆">自然史博物馆</h3>
<p>​不知不觉到了周四。这天主要的安排是去西区看音乐剧，空闲出来的上午便就近去自然史博物馆逛逛。</p>
<p>自然史博物馆在肯辛顿公园南，步行可达。博物馆北就是伦敦帝国学院。这是欧洲最大的自然科学博物馆，主楼便器宇不凡。​</p>
<figure class="center"><img src="https://gh-1251443721.cos.ap-chengdu.myqcloud.com/2020/0213/001ZzLsRzy7AMToNw5Bf3.jpeg" width="100%"/><figcaption>
            <h4>图 | 伦敦·自然史博物馆</h4>
        </figcaption>
</figure>
    </div>
    <div class="read-more">
      <a href="/post/london-trip-20202-5/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/london-trip-2020-4/">2020年初伦敦行(4)：剑桥</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2020-02-12 </span>
      <div class="post-category">
          <a href="/categories/%E6%97%85%E6%B8%B8/"> 旅游 </a>
          </div>
        <span class="more-meta"> 约 2714 字 </span>
        <span class="more-meta"> 预计阅读 6 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <h2 id="1-29-剑桥">1-29 剑桥</h2>
<p>​又是个（难得的）晴天。按计划，到利物浦街（Liverpool Street）坐火车去剑桥。</p>
<p>利物浦街车站比​Paddington要新一点。站厅里有个矮墙围起来的区域，放满了自行车。英国人似乎很喜欢骑自行车到地铁/火车站，把车丢那儿，再坐轨交通勤。不过列车指示很不清晰，没有火车车次，只显示目标终点站和发车时间，得自己比照。差不多发车前20分钟，车次信息才上屏。打开提前下载好的Trainline应用，调出车票二维码，就可以扫码进站。和中国相比，最显著的不同是「不需要实名制」。</p>
<figure class="center"><img src="https://gh-1251443721.cos.ap-chengdu.myqcloud.com/2020/0212/001ZzLsRzy7AMROyOeqb6.jpeg" width="100%"/><figcaption>
            <h4>图 | 伦敦·利物浦街车站</h4>
        </figcaption>
</figure>
<p>火车是Great Anglia公司运营的，开得不快，不过有免费wifi。一路都是英式村镇，草还是绿的，但乔木的叶子已经落光了，枝条萧索纠缠地聚成一堆。</p>
    </div>
    <div class="read-more">
      <a href="/post/london-trip-2020-4/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/london-trip-2020-3/">2020年初伦敦行(3)：西敏寺、格林威治</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2020-02-11 </span>
      <div class="post-category">
          <a href="/categories/%E6%97%85%E6%B8%B8/"> 旅游 </a>
          </div>
        <span class="more-meta"> 约 2370 字 </span>
        <span class="more-meta"> 预计阅读 5 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <h2 id="1-28-伦敦">1-28 伦敦</h2>
<h3 id="伦敦塔桥">伦敦塔桥</h3>
<p>​London Pass赶场打卡日。</p>
<figure class="center"><img src="https://gh-1251443721.cos.ap-chengdu.myqcloud.com/2020/0211/001ZzLsRzy7AWqF77Mo6c.jpeg" width="100%"/><figcaption>
            <h4>图 | Big Bus Tour线路图</h4>
        </figcaption>
</figure>
<p>London Pass包含Big Bus和Original Tour两家公司的观光巴士。我们打算到绿园（Green Park）坐Big Bus的红线（经典线路），大致以Green Park为中心，把泰晤士河两岸的伦敦塔桥、议会大厦、圣保罗座堂、西敏寺等都兜一遍，行经路线主要是伦敦金融城的核心地段。</p>
    </div>
    <div class="read-more">
      <a href="/post/london-trip-2020-3/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/london-trip-2020-2/">2020年初伦敦行(2)：肯辛顿、温莎堡</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2020-02-10 </span>
      <div class="post-category">
          <a href="/categories/%E6%97%85%E6%B8%B8/"> 旅游 </a>
          </div>
        <span class="more-meta"> 约 2423 字 </span>
        <span class="more-meta"> 预计阅读 5 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <h2 id="抵达伦敦">抵达伦敦</h2>
<p>十个小时飞行，一飞机的人都全程口罩，气氛严肃。落地是伦敦当地周日的七点。过关时提交一份健康申明，并未测温。坐上<a href="https://metromaplondon.com/">Piccadilly线</a>（地图一般标记为靛青线），从希思罗机场直趋Earls Court。</p>
<p>这是条古老的线路（但还不是最老），咣当咣当地往东开。震动厉害时，车厢照明灯都会熄灭几盏。车厢里没几个人，忽明忽暗间有一种诡异的氛围。站台也不那么严丝合缝，部分站台比车厢地板高三四十公分。并不是所有站都适合残疾人上下车。</p>
<p>Earls Court是个换乘大站，上两层站台才到地面。走上Earls Court路，街上人还不少。​丁字路口没有红绿灯，我们跟着本地人趁空穿过马路，折入一条小巷。酒店就在其中一排民居中间。</p>
<p>早餐是清晨服务员送到门口的。一壶浓咖啡，三瓶果汁，数个面包+奶酪+果酱。很丰盛，感动地大吃一顿。谁料后面几日天天如此，完全不变。​真是「最优实践」实践到吐呢。</p>
<figure class="center"><img src="https://gh-1251443721.cos.ap-chengdu.myqcloud.com/2020/0210/001ZzLsRzy7AMb7dwkk14.jpeg" width="80%"/><figcaption>
            <h4>图 | 每日早餐</h4>
        </figcaption>
</figure>
    </div>
    <div class="read-more">
      <a href="/post/london-trip-2020-2/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/london-trip-2020-1/">2020年初伦敦行(1)：西安出发</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2020-02-09 </span>
      <div class="post-category">
          <a href="/categories/%E6%97%85%E6%B8%B8/"> 旅游 </a>
          </div>
        <span class="more-meta"> 约 1951 字 </span>
        <span class="more-meta"> 预计阅读 4 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <div class="admonition abstract"><p class="admonition-title">行前</p>
<p>Google可视化地图 &raquo;&gt; <a href="http://drive.google.com/open?id=1xvs0tCLbYpKeIhqjAXhwElEN1TewLJd_&amp;usp=sharing">在此（需翻墙访问）</a>。</p>
</div>
<h2 id="绪">绪</h2>
<p>伦敦之行​策划得很仓促。早在十月，规划春节出游计划时，大统领刷手机突然发现春节初期飞英国的机票蛮优惠，于是就下手抢了一对。这便拉开了序幕。</p>
<div class="admonition tip"><p class="admonition-title">其实</p>
<p>机票便宜是因为英国正在脱欧，大家都怕那里闹事。一分价钱一分货，老话几时骗过人。</p>
</div>
    </div>
    <div class="read-more">
      <a href="/post/london-trip-2020-1/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/zhen-de-di-yi-xing/">不要妥协，坚持「真」的第一性</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2020-02-05 </span>
      <div class="post-category">
          <a href="/categories/%E6%97%B6%E8%AF%84/"> 时评 </a>
          </div>
        <span class="more-meta"> 约 2724 字 </span>
        <span class="more-meta"> 预计阅读 6 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <h2 id="1">1</h2>
<p>这些天，高福和王广发都被喷得不成人形。舆情汹汹，势同公审。</p>
<p>讲真，王广发是比较冤的。他是唯一被感染的高级专家，说明他真的下地干活了。他一个临床专家，习惯批阅个案而不是分析关联，哪有胆气说「没有人传人」？至于「可防可治可控」，是03 SARS中期钟南山喊出的口号，用来稳定军心。你理解成医学界的「有没有信心？有！」就好了。这次换人用，结果失灵了，并不能怪王广发。当时一个像样的人群措施都没上，喊什么口号都必然失败。</p>
<p>高福呢？冤，也不冤。网传他只管抢写论文，不管防控。这是胡说。大家了解一下，论文作者的排名是有讲究的。第一名叫一作，实际执笔人，一般只有一作才算「写了本文」；第二名叫二作，通常是主要协作人，但国内也常有二作实际执笔，一作受益的情况，道理你懂的；第三名叫三作，出力次之；后面基本都是群演，相当于影片最末的演职员表被提到了片头；而最后一名又是例外，叫通讯作者，知识产权所有人，相当于老板。网传那篇<a href="https://www.nejm.org/doi/pdf/10.1056/NEJMoa2001316?articleTools=true">新英格兰医学杂志的高影响因子论文</a>，高福列名靠后，既不是前三作，也不是通讯作者，充其量友情署名，起了个「领导背书」的作用。可以很笃定地讲，这篇文章高福一个字都没有写，他的主要精力肯定是放在防控上了。</p>
<figure class="center"><img src="https://gh-1251443721.cos.ap-chengdu.myqcloud.com/2020/0205/gaofu-nejm-paper.png"
         alt="高福论文"/><figcaption>
            <h4>图 | 网传高福抢发的新英格兰杂志高IF论文</h4>
        </figcaption>
</figure>
    </div>
    <div class="read-more">
      <a href="/post/zhen-de-di-yi-xing/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/django-website-demo-2/">edX作业：用Django建一个简易Web订单系统(2)</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2019-11-07 </span>
      <div class="post-category">
          <a href="/categories/%E6%8A%80%E6%9C%AF/"> 技术 </a>
          </div>
        <span class="more-meta"> 约 6710 字 </span>
        <span class="more-meta"> 预计阅读 14 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <h3 id="admin后台">Admin后台</h3>
<p><a href="/post/django-website-demo-1/">接上篇</a></p>
<p>模型做好后，可以在<a href="https://github.com/madlogos/edx_cs50/blob/master/project3/orders/admin.py">admin.py</a>里注册一下。这样就能像User类一样，在Django后台管理界面维护这些数据。</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span><span class="lnt">21
</span><span class="lnt">22
</span><span class="lnt">23
</span><span class="lnt">24
</span><span class="lnt">25
</span><span class="lnt">26
</span><span class="lnt">27
</span><span class="lnt">28
</span><span class="lnt">29
</span><span class="lnt">30
</span><span class="lnt">31
</span><span class="lnt">32
</span><span class="lnt">33
</span><span class="lnt">34
</span><span class="lnt">35
</span><span class="lnt">36
</span><span class="lnt">37
</span><span class="lnt">38
</span><span class="lnt">39
</span><span class="lnt">40
</span><span class="lnt">41
</span><span class="lnt">42
</span><span class="lnt">43
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="c1"># orders/admin.py</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">django.contrib</span> <span class="kn">import</span> <span class="n">admin</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">.models</span> <span class="kn">import</span> <span class="n">Category</span><span class="p">,</span> <span class="n">Product</span><span class="p">,</span> <span class="n">Topping</span><span class="p">,</span> <span class="n">Addition</span><span class="p">,</span> <span class="n">Order</span><span class="p">,</span> <span class="n">Item</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Register your models here.</span>
</span></span><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">CategoryAdmin</span><span class="p">(</span><span class="n">admin</span><span class="o">.</span><span class="n">ModelAdmin</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">list_display</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">,</span> <span class="p">]</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">admin</span><span class="o">.</span><span class="n">site</span><span class="o">.</span><span class="n">register</span><span class="p">(</span><span class="n">Category</span><span class="p">,</span> <span class="n">CategoryAdmin</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">ProductAdmin</span><span class="p">(</span><span class="n">admin</span><span class="o">.</span><span class="n">ModelAdmin</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">list_display</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;id&#39;</span><span class="p">,</span> <span class="s1">&#39;name&#39;</span><span class="p">,</span> <span class="s1">&#39;category&#39;</span><span class="p">,</span> <span class="s1">&#39;size&#39;</span><span class="p">,</span> <span class="s1">&#39;price&#39;</span><span class="p">,</span> <span class="s1">&#39;n_topping&#39;</span><span class="p">,</span> 
</span></span><span class="line"><span class="cl">                    <span class="s1">&#39;n_addition&#39;</span><span class="p">,</span> <span class="s1">&#39;created&#39;</span><span class="p">,</span> <span class="s1">&#39;updated&#39;</span><span class="p">]</span>
</span></span><span class="line"><span class="cl">    <span class="n">list_filter</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;category&#39;</span><span class="p">,</span> <span class="s1">&#39;size&#39;</span><span class="p">,</span> <span class="s1">&#39;created&#39;</span><span class="p">,</span> <span class="s1">&#39;updated&#39;</span><span class="p">]</span>
</span></span><span class="line"><span class="cl">    <span class="n">list_editable</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;price&#39;</span><span class="p">,</span> <span class="s1">&#39;size&#39;</span><span class="p">,</span> <span class="s1">&#39;n_topping&#39;</span><span class="p">,</span> <span class="s1">&#39;n_addition&#39;</span><span class="p">,</span> <span class="p">]</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">admin</span><span class="o">.</span><span class="n">site</span><span class="o">.</span><span class="n">register</span><span class="p">(</span><span class="n">Product</span><span class="p">,</span> <span class="n">ProductAdmin</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">ToppingAdmin</span><span class="p">(</span><span class="n">admin</span><span class="o">.</span><span class="n">ModelAdmin</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">list_display</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">,</span> <span class="s1">&#39;price&#39;</span><span class="p">]</span>
</span></span><span class="line"><span class="cl">    <span class="n">list_editable</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;price&#39;</span><span class="p">,</span> <span class="p">]</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">admin</span><span class="o">.</span><span class="n">site</span><span class="o">.</span><span class="n">register</span><span class="p">(</span><span class="n">Topping</span><span class="p">,</span> <span class="n">ToppingAdmin</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">AdditionAdmin</span><span class="p">(</span><span class="n">admin</span><span class="o">.</span><span class="n">ModelAdmin</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">list_display</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">,</span> <span class="s1">&#39;size&#39;</span><span class="p">,</span> <span class="s1">&#39;price&#39;</span><span class="p">]</span>
</span></span><span class="line"><span class="cl">    <span class="n">list_filter</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;size&#39;</span><span class="p">,]</span>
</span></span><span class="line"><span class="cl">    <span class="n">list_editable</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;size&#39;</span><span class="p">,</span> <span class="s1">&#39;price&#39;</span><span class="p">,</span> <span class="p">]</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">admin</span><span class="o">.</span><span class="n">site</span><span class="o">.</span><span class="n">register</span><span class="p">(</span><span class="n">Addition</span><span class="p">,</span> <span class="n">AdditionAdmin</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">OrderItemInline</span><span class="p">(</span><span class="n">admin</span><span class="o">.</span><span class="n">TabularInline</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">model</span> <span class="o">=</span> <span class="n">Order</span><span class="o">.</span><span class="n">item</span><span class="o">.</span><span class="n">through</span>
</span></span><span class="line"><span class="cl">    <span class="n">readonly_fields</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;item&#39;</span><span class="p">,</span> <span class="s1">&#39;quantity&#39;</span><span class="p">,]</span>
</span></span><span class="line"><span class="cl">    <span class="n">extra</span> <span class="o">=</span> <span class="mi">0</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">OrderAdmin</span><span class="p">(</span><span class="n">admin</span><span class="o">.</span><span class="n">ModelAdmin</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">list_display</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;id&#39;</span><span class="p">,</span> <span class="s1">&#39;user&#39;</span><span class="p">,</span> <span class="s1">&#39;quantity&#39;</span><span class="p">,</span> <span class="s1">&#39;price&#39;</span><span class="p">,</span> <span class="s1">&#39;status&#39;</span><span class="p">,</span> <span class="s1">&#39;created&#39;</span><span class="p">,</span> <span class="s1">&#39;updated&#39;</span><span class="p">]</span>
</span></span><span class="line"><span class="cl">    <span class="n">list_editable</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;status&#39;</span><span class="p">,</span> <span class="p">]</span>
</span></span><span class="line"><span class="cl">    <span class="n">readonly_fields</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;user&#39;</span><span class="p">,</span> <span class="s1">&#39;quantity&#39;</span><span class="p">,</span> <span class="s1">&#39;price&#39;</span><span class="p">,</span> <span class="p">]</span>
</span></span><span class="line"><span class="cl">    <span class="n">inlines</span> <span class="o">=</span> <span class="p">(</span><span class="n">OrderItemInline</span><span class="p">,</span> <span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">admin</span><span class="o">.</span><span class="n">site</span><span class="o">.</span><span class="n">register</span><span class="p">(</span><span class="n">Order</span><span class="p">,</span> <span class="n">OrderAdmin</span><span class="p">)</span>
</span></span></code></pre></td></tr></table>
</div>
</div>
    </div>
    <div class="read-more">
      <a href="/post/django-website-demo-2/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/django-website-demo-1/">edX作业：用Django建一个简易Web订单系统(1)</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2019-11-06 </span>
      <div class="post-category">
          <a href="/categories/%E6%8A%80%E6%9C%AF/"> 技术 </a>
          </div>
        <span class="more-meta"> 约 131 字 </span>
        <span class="more-meta"> 预计阅读 1 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <div class="admonition abstract"><p class="admonition-title">摘要</p>
<p>还是edx的作业。今次要换用Django框架实现一个Pizza点单系统。<br/>
【honor code警告】如果你刚巧也注册了这门课，千万不要抄。</p>
</div>
<div class="admonition warning"><p class="admonition-title">注意</p>
<p>如无法显示视频，可能被作为不安全脚本屏蔽。在浏览器地址栏里点击安全提示图标，允许运行不安全的脚本。</p>
</div>
<p><a href="https://v.youku.com/v_show/id_XNDQzNzY0NTEwNA==.html?spm=a2hzp.8244740.0.0">成品效果视频</a> @ 优酷：</p>
<iframe height=498 width='100%' src='https://player.youku.com/embed/XNDQzNzY0NTEwNA==' frameborder=0 'allowfullscreen'></iframe>
<p>这是哈佛<strong>继续教育学院</strong>开的的<a href="https://courses.edx.org/courses/course-v1:HarvardX+CS50W+Web/course/">用Python和Javascript撸网络编程</a> 第四个作业项目。</p>
<h2 id="作业要求httpsdocscs50netweb2019xprojects3project3html"><a href="https://docs.cs50.net/web/2019/x/projects/3/project3.html">作业要求</a></h2>
<p>做一个仿<a href="http://www.pinocchiospizza.net/menu.html">Pinocchio Pizza</a>的Pizza预订系统。</p>
<div class="admonition bug"><p class="admonition-title">可以看到</p>
<p>很明显，这个网站做得很渣。但是据说在哈佛所在的坎布里奇特别受欢迎，以特色潜艇堡（subs）著称。<b>技术还是不如业务重要。</b></p>
</div>
<p>要实现以下功能：</p>
<ol>
<li>分析样品菜单，构建模型</li>
<li>用Django admin或者写Python命令，添加菜单内容</li>
<li>用户注册、登录、登出</li>
<li>虚拟购物车</li>
<li>下订单</li>
<li>浏览订单和订单明细</li>
<li>延伸功能：比如系统管理员在后台更新订单状态、用<a href="https://stripe.com/docs">Strip API</a> 完成结算等</li>
</ol>
    </div>
    <div class="read-more">
      <a href="/post/django-website-demo-1/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/flask-socketio-site-demo/">edX作业：用Flask建一个简易Web聊天室</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2019-11-01 </span>
      <div class="post-category">
          <a href="/categories/%E6%8A%80%E6%9C%AF/"> 技术 </a>
          </div>
        <span class="more-meta"> 约 93 字 </span>
        <span class="more-meta"> 预计阅读 1 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <div class="admonition abstract"><p class="admonition-title">摘要</p>
<p>记载了「通往全栈之路上」的一则edx慕课作业：用flask_socketio实现一个粗糙的聊天室。<br/>
【honor code警告】如果你刚巧也注册了这门课，千万不要抄。</p>
</div>
<p><a href="https://v.youku.com/v_show/id_XNDQzNzYyNDU4MA==.html?spm=a2h3j.8428770.3416059.1">成品效果视频</a> @ 优酷：</p>
<iframe height=498 width='100%' src='https://player.youku.com/embed/XNDQzNzYyNDU4MA==' frameborder=0 'allowfullscreen'></iframe>
<p>这是哈佛 <strong>继续教育学院</strong> 开的的<a href="https://courses.edx.org/courses/course-v1:HarvardX+CS50W+Web/course/">用Python和Javascript撸网络编程</a> 第三个作业项目。</p>
<h2 id="作业要求httpsdocscs50netweb2019xprojects2project2html"><a href="https://docs.cs50.net/web/2019/x/projects/2/project2.html">作业要求</a></h2>
<p>做一个仿<a href="www.slack.com">Slack</a>概念的聊天应用。这次不需要用数据库了，但得</p>
<p>要实现以下功能：</p>
<ol>
<li>能自定义用户名（不能和已有的重复）</li>
<li>能创建频道</li>
<li>能看频道列表</li>
<li>进频道能看到所有消息，但最多显示100条</li>
<li>能在频道中发送消息</li>
<li>能记住频道，下次回来能立即进去</li>
<li>延伸功能：比如删除自己的消息，上传附件等</li>
</ol>
    </div>
    <div class="read-more">
      <a href="/post/flask-socketio-site-demo/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/hulunber-trip-2019-4/">2019夏末呼伦贝尔行(4)：呼伦湖、满洲里</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2019-10-27 </span>
      <div class="post-category">
          <a href="/categories/%E6%97%85%E6%B8%B8/"> 旅游 </a>
          </div>
        <span class="more-meta"> 约 1507 字 </span>
        <span class="more-meta"> 预计阅读 4 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <h2 id="第四日">第四日</h2>
<figure class="center"><img src="https://gh-1251443721.cos.ap-chengdu.myqcloud.com/2019/1027/001ZzLsRzy7y5llQeq2d6.jpeg" width="100%"/><figcaption>
            <h4>图 | 第四日路书</h4>
        </figcaption>
</figure>
    </div>
    <div class="read-more">
      <a href="/post/hulunber-trip-2019-4/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    </section>
  
  <nav class="pagination">
    <a class="prev" href="/page/2/">
        <i class="iconfont icon-left"></i>
        <span class="prev-text">上一页</span>
      </a>
    <a class="next" href="/page/4/">
        <span class="next-text">下一页</span>
        <i class="iconfont icon-right"></i>
      </a>
  </nav>
        </div>
        

      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="social-links">
      <a href="mailto:madlogos@gmail.com" class="iconfont icon-email" title="email"></a>
      <a href="https://stackoverflow.com/users/5455754/madlogos?tab=profile" class="iconfont icon-stack-overflow" title="stack-overflow"></a>
      <a href="https://twitter.com/madlogos" class="iconfont icon-twitter" title="twitter"></a>
      <a href="https://www.facebook.com/madlogos" class="iconfont icon-facebook" title="facebook"></a>
      <a href="http://www.linkedin.com/in/yiying-wang/" class="iconfont icon-linkedin" title="linkedin"></a>
      <a href="https://plus.google.com/&#43;%E6%B1%AA%E8%BD%B6%E9%A2%96madlogos" class="iconfont icon-google" title="google"></a>
      <a href="http://github.com/madlogos" class="iconfont icon-github" title="github"></a>
      <a href="https://weibo.com/madlogos/" class="iconfont icon-weibo" title="weibo"></a>
      <a href="https://www.zhihu.com/people/madlogos/" class="iconfont icon-zhihu" title="zhihu"></a>
      <a href="https://www.douban.com/people/Jandeaux/" class="iconfont icon-douban" title="douban"></a>
      <a href="https://jandeaux.tumblr.com" class="iconfont icon-tumblr" title="tumblr"></a>
      <a href="https://www.instagram.com/jandeaux/" class="iconfont icon-instagram" title="instagram"></a>
      <a href="https://gitlab.com/madlogos" class="iconfont icon-gitlab" title="gitlab"></a>
      <a href="https://space.bilibili.com/384080442" class="iconfont icon-bilibili" title="bilibili"></a>
  <a href="https://madlogos.github.io/index.xml" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
</div>

<div class="copyright">
  <span class="power-by">
    由 <a class="hexo-link" href="https://gohugo.io">Hugo</a> 强力驱动
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    主题 - 
    <a class="theme-link" href="https://github.com/olOwOlo/hugo-theme-even">Even</a>
  </span>

  <div class="busuanzi-footer">
    <span id="busuanzi_container_site_pv"> 本站总访问量 <span id="busuanzi_value_site_pv"><img src="/img/spinner.svg" alt="spinner.svg"/></span> 次 </span>
      <span class="division">|</span>
    <span id="busuanzi_container_site_uv"> 本站总访客数 <span id="busuanzi_value_site_uv"><img src="/img/spinner.svg" alt="spinner.svg"/></span> 人 </span>
  </div>

  <span class="copyright-year">
    &copy; 
    2017 - 
    2022
    
    <span class="author">madlogos</span>
  </span>
</div>

    </footer>

    <div class="back-to-top" id="back-to-top">
      <i class="iconfont icon-up"></i>
    </div>
  </div>
  
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/slideout@1.0.1/dist/slideout.min.js" integrity="sha256-t+zJ/g8/KXIJMjSVQdnibt4dlaDxc9zXr/9oNPeWqdg=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js" integrity="sha256-yt2kYMy0w8AbtF89WXb2P1rfjcP/HTHLT7097U8Y5b8=" crossorigin="anonymous"></script><script></script><script src="https://cdn.jsdelivr.net/npm/raphael@2.3.0/raphael.min.js" integrity="sha256-TabprKdeNXbSesCWLMrcbWSDzUhpAdcNPe5Q53rn9Yg=" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/flowchart.js@1.12.1/release/flowchart.min.js" integrity="sha256-ANSuVJkHZftRURALG24omixaZG+Sb51/+JY6EDa7MdE=" crossorigin="anonymous"></script><script></script><script src="https://cdn.jsdelivr.net/npm/webfontloader@1.6.28/webfontloader.js" integrity="sha256-4O4pS1SH31ZqrSO2A/2QJTVjTPqVe+jnYgOWUVr7EEc=" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/snapsvg@0.5.1/dist/snap.svg-min.js" integrity="sha256-oI+elz+sIm+jpn8F/qEspKoKveTc5uKeFHNNVexe6d8=" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/underscore@1.10.2/underscore-min.js" integrity="sha256-av1TvywtZ4ZqyCj/6HdtCHSJdn80HAzTgEBTJt/O8uc=" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/@rokt33r/js-sequence-diagrams@2.0.6-2/dist/sequence-diagram-min.js" integrity="sha256-eadHf9g1REH9Wvp2FLV/D9vKNvQUFKuVPgWFvmMQxBE=" crossorigin="anonymous"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@rokt33r/js-sequence-diagrams@2.0.6-2/dist/sequence-diagram-min.css" integrity="sha256-On01v36B8LRDuL2tqhqs7Gb3Cm/NIpsLFy4OarOodUA=" crossorigin="anonymous">



<script type="text/javascript" src="/js/main.min.4ae89da218555efa0e7093a20b92017d2e1202b66fff9fc2edf4cb8d44b44c6e.js"></script>
  <script type="text/javascript">
    window.MathJax = {
      tex: {
        inlineMath: [['$','$'], ['\\(','\\)']],
        tags: 'ams',
        }
    };
  </script>
  <script async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js" integrity="sha256-HGLuEfFcsUJGhvB8cQ8nr0gai9EucOOaIxFw7qxmd+w=" crossorigin="anonymous"></script>


<script type="application/javascript">
var doNotTrack = false;
if (!doNotTrack) {
	window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
	ga('create', 'UA-68964085-2', 'auto');
	ga('set', 'anonymizeIp', true);
	ga('send', 'pageview');
}
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<script id="baidu_analytics">
  var _hmt = _hmt || [];
  (function() {
    if (window.location.hostname === 'localhost') return;
    var hm = document.createElement("script"); hm.async = true;
    hm.src = "https://hm.baidu.com/hm.js?f221e23428218df65adeefe00f85e7ed";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
  })();
</script>

<script id="baidu_push">
  (function(){
    if (window.location.hostname === 'localhost') return;
    var bp = document.createElement('script'); bp.async = true;
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
      bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
      bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
  })();
</script>


<script src="/js/custom.js"></script>


</body>
</html>
